<?php

namespace Tools\Utils;

/**
 * Class Code
 * @package cunzan\utils
 * 20000 ~ 30000 成功状态码, 20001~20050 非模块错误码, >2010 模块错误码,每个模块预留50个号码
 * 40000 ~ 50000 错误状态码
 */
class Code
{
    // 40000 用户自定义错误码
    public const RequestOk = 20001;
    public const RequestFaild = 40001;
    public const AddOk = 20002;
    public const AddFaild = 40002;
    public const DeleteOk = 20003;
    public const DeleteFaild = 40003;
    public const ChangeOk = 20004;
    public const ChangeFaild = 40004;
    public const FindOk = 20005;
    public const FindFaild = 40005;
    public const FindNull = 40006;
    public const ArguFaild = 40010;
    public const ArguMiss = 40011;
    public const ArguValidateFaild = 40011;
    public const LoginOk = 20100;
    public const LoginFaild = 40100;
    public const LoginNo = 40101;
    public const DataNotFound = 40150;
    public const LoginPwdInitOk = 20102;
    public const LoginPwdInitFaild = 40102;
    public const AccountForbidden = 40200;
    public const AccountFrequent = 40201;
    public const AccountApplyFaild = 40202;
    public const AccountApplyOk = 20202;
    public const SlideImageValidFalid = 40250;
    public const HttpPermissionForbidden = 40403;

    public static $message = [
        20001 => '请求成功',
        40001 => '请求失败',

        /** 增删改查 相关操作 **/
        20002 => '添加成功',
        40002 => '添加失败',

        20003 => '删除成功',
        40003 => '删除失败',

        20004 => '修改成功',
        40004 => '修改失败',

        20005 => '查询成功',
        40005 => '查询失败',

        40006 => '未查询到相关数据',

        40010 => '参数错误',
        40011 => '参数丢失',

        /** 登录模块 **/
        20100 => '登录成功',
        40100 => '登录失败',
        40101 => '用户未登录，请登陆后操作',
        20102 => '密码初始化成功',
        40102 => '密码初始化失败',

        /** sql相关操作 **/
        40150 => '查找不到数据',

        /** 账号相关 **/
        40200 => '账户被禁用',
        40201 => '操作过于频繁，请稍后再试',
        20202 => '申请成功',
        40202 => '申请失败',

        /** 滑动验证码相关 **/
        40250 => '位置错误',

        /**  http 4xx 扩展方面 **/
        40403 => '权限禁止'     //扩展http
    ];
}
